<?php
if(!defined('FROM_INDEX'))exit('Invalid request');

function add_comment_sql()
{
	return <<<SQL
insert into `tra_travel_comment`
	(`item_id`, `visitor_id`, `service_score`, `env_score`, 
	`price_score`, `desc`, `create_date`)
values
	(?, ?, ?, ?,
	?, ?, ?)
SQL;
}

function add_complaint_sql()
{
	return <<<SQL
insert into `tra_travel_complaint`
	(`item_id`, `visitor_id`, `reason`, `address`, 
	`name`, `telephone`, `image`,
	`create_date`, `update_date`)
values
	(?, ?, ?, ?,
	?, ?, ?,
	?, ?)
SQL;
}

function update_complaint_favorite_count_sql()
{
	return <<<SQL
update
	`tra_travel_complaint`
set
	favorite_count = favorite_count + 1
where
	`id` = ?
SQL;
}

function update_scenic_favorite_count_sql()
{
	return <<<SQL
update
	`tra_travel_scenic`
set
	favorite_count = favorite_count + 1
where
	`item_id` = ?
SQL;
}

function add_hostel_comment_sql()
{
	return <<<SQL
insert into `tra_hostel_comment`
	(`hostel_id`, `score`, `desc`, `is_show`, 
	`create_user`, `create_date`, `update_user`, `update_date`)
values
	(?, ?, ?, ?,
	?, ?, ?, ?)
SQL;
}

function add_scenic_comment_sql()
{
	return <<<SQL
insert into `tra_scenic_comment`
	(`scenic_id`, `score`, `desc`, `is_show`,
	`create_user`, `create_date`, `update_user`, `update_date`)
values
	(?, ?, ?, ?,
	?, ?, ?, ?)
SQL;
}